Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

avm1: Set ConvolutionFilter's alpha to 1 when initialized with a color #18324

Merged
merged 2 commits into from
Oct 22, 2024

Conversation

britt-j
Copy link
Contributor

@britt-j britt-j commented Oct 19, 2024

In AVM1, initializing a ConvolutionFilter with a substitute color will result in the substitute alpha being set to 1.
This doesn't happen in AVM2.

Tested on SWFv8 and SWFv43.

@kjarosh kjarosh added A-avm1 Area: AVM1 (ActionScript 1 & 2) filter-effects Issues involving filter effects such as Blur, Glow, etc. T-fix Type: Bug fix (in something that's supposed to work already) labels Oct 21, 2024
Copy link
Contributor

@Dinnerbone Dinnerbone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, nice catch!

…ha to 1

Initializing ConvolutionFilter with a substitute color will result in the alpha being set to 1 in AVM1, despite the documentation claiming alpha always defaults to 0.
@Dinnerbone Dinnerbone force-pushed the avm1-convolution-alpha-default branch from 549b530 to a30475e Compare October 21, 2024 22:56
@kjarosh
Copy link
Member

kjarosh commented Oct 22, 2024

Fun fact: the documentation claims the default value of alpha is 0, but in the example a line below that claim, it says that the example changes alpha from the default value of 1 to 0.35. The constructor doc doesn't mention anything about the default value.

@kjarosh kjarosh merged commit 678f869 into ruffle-rs:master Oct 22, 2024
17 checks passed
@britt-j britt-j deleted the avm1-convolution-alpha-default branch October 28, 2024 18:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-avm1 Area: AVM1 (ActionScript 1 & 2) filter-effects Issues involving filter effects such as Blur, Glow, etc. T-fix Type: Bug fix (in something that's supposed to work already)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants